﻿#pragma once

#include "ais_base.h"
#include "geom/geom_point.h"
#include "geom/geom_vector.h"

namespace CAGD
{

/**
 * 交互向量.
 */
class AIS_Vector : public AIS_Base
{
  public:
    /**
     * @brief 基本构造.
     * @param vec
     * @param origin
     * @param color
     * @see
     */
    AIS_Vector(Handle(GeomVector) vec, Handle(GeomPoint) origin);

    /**
     * @brief 检测函数.
     * @return
     * @param pos
     * @see
     */
    bool MoveTo(Point pos) override;

    /**
     * @brief 移动函数.
     * @param pos
     * @see
     */
    bool Move(Point pos) override;

    /**
     * @brief 点击函数.
     * @return
     * @param pos
     * @see
     */
    bool Click(Point pos) override;

    /**
     * @brief 释放函数.
     * @return
     * @param pos
     * @see
     */
    bool Release(Point pos) override;

    /**
     * @brief 获得类型.
     * @return
     * @see
     */
    AIS_Type GetType() const override;

    /**
     * @brief 刷新信息.
     * @return
     * @see
     */
    void UpdateInfo() override;

    /**
     * @brief 接收消息.
     * @param mess
     * @see
     */
    void RecvMessage(Message mess) override;

    /**
     * @brief 获得向量.
     * @return
     * @see
     */
    Handle(GeomVector) GetVector() const;

    /**
     * @brief 获得起始点.
     * @return
     * @see
     */
    Handle(GeomPoint) GetOrigin() const;

  protected:
    Handle(GeomVector) m_vector;
    Handle(GeomPoint) m_origin;

    // 记录交互数据
    BPnt m_stick;
};

} // namespace CAGD
